<template>
    <div class="container">
        <b-card title="Сведения об эксперте:">
            <b-card-text>
                <h5>Фамилия: {{ lastName }}</h5>
                <h5>Имя: {{ firstName }}</h5>
                <h5>Отчество: {{ patronymic }}</h5>
                <h5>Должность: {{ position }}</h5>
                <h5>Образование: {{ education }}</h5>
                <h5>Опыт работы: {{ experience }}</h5>
                <h5>Адрес: {{ address }}</h5>
                <h5>Номер телефона: {{ phoneNumber }}</h5>
                <h5>Email: {{ email }}</h5>
                <h5>Информация об отпусках и больничных: {{ vacationInfo }}</h5>
                <h5>Экспертизы:
                    <p v-for="expertise in expertises" :key="expertise.id">
                        <router-link
                            :to="`/expertise/${expertise.id}`"
                        >
                            {{ expertise.type_expertise }}
                        </router-link>
                    </p>
                </h5>
            </b-card-text>
        </b-card>
    </div>
</template>
<script>
export default {
    data() {
        return {
            firstName: "",
            lastName: "",
            patronymic: "",
            position: "",
            education: "",
            experience: "",
            expertises: "",
            address: "",
            phoneNumber: "",
            email: "",
            vacationInfo: ""
        };
    },
    created() {
        this.$http.get("/expert/" + this.$route.params.id)
            .then(response => {
                this.firstName = response.data.first_name,
                this.lastName = response.data.last_name,
                this.patronymic = response.data.patronymic,
                this.position = response.data.position,
                this.education = response.data.education,
                this.experience = response.data.experience,
                this.address = response.data.address,
                this.phoneNumber = response.data.phone_number,
                this.email = response.data.email,
                this.vacationInfo = response.data.vacation_information
                this.expertises = response.data.expertises

            })
    }
};
</script>

<style>
</style>
